<?php
class SF_CategoryPage_AutomobilesController extends Mage_Core_Controller_Front_Action
{
	public function automobilesAction(){
		$code = $this->getRequest()->getParam('code');
        
        $block = $this->getLayout()->createBlock('categorypage/automobiles');
        $size = $this->getRequest()->getParam('size');
        switch($code){
        	case 'load':
                $collection = $block->getProuducts();
                break;
			case 'click':
                $collection = $block->getProuductsClick($size);
                break;
        }
        $collection['size']=$size;
        echo json_encode($collection);
    }
}